package design.action.模板;

public abstract class Animal {

    //todo 可变部分
    protected abstract void eat();


    public final void enjoy() {
        //todo 主要逻辑
        eat();
        System.out.println("吃完了睡觉");
    }


    public static void main(String[] args) {
        Animal dog = new Dog();
        dog.enjoy();
    }
}
